<script>
	import Vue from 'vue'
	export default {
		onLaunch: function() {
			uni.getSystemInfo({
				success: function(e) {
					// #ifndef MP
					Vue.prototype.StatusBar = e.statusBarHeight;
					if (e.platform == 'android') {
						Vue.prototype.CustomBar = e.statusBarHeight + 50;
					} else {
						Vue.prototype.CustomBar = e.statusBarHeight + 45;
					};
					// #endif
					// #ifdef MP-WEIXIN
					Vue.prototype.StatusBar = e.statusBarHeight;
					let custom = wx.getMenuButtonBoundingClientRect();
					Vue.prototype.Custom = custom;
					Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
					// #endif		
					// #ifdef MP-ALIPAY
					Vue.prototype.StatusBar = e.statusBarHeight;
					Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
					// #endif
				},
				fail: function(res) {
					console.log('getSystemInfoFail' + res)
				}
			})
			
			uni.getStorage({
				key:'user',
				success:(res)=>{
					console.log('登陆过');
					getApp().globalData.user =res.data
				},
				fail() {
					console.log('未登录过');
				}
			})
			
		},
		onShow: function() {},
		onHide: function() {},

		globalData: {
			serverUrl: "https://www.2306.tech/CCShop/",
			user: {
				// "userSex": 1,
				// "userPassword": "",
				// "userStatus": 1,
				// "userOpenid": "o6E-Q4sXR8yO4T4U9DzPKchpiLwM",
				// "userRealName": "王镭树",
				// "userScore": 972,
				// "userId": "o6E-Q4sXR8yO4T4U9DzPKchpiLwM",
				// "userRegisterTime": {
				// 	"date": 29,
				// 	"hours": 0,
				// 	"seconds": 0,
				// 	"month": 5,
				// 	"timezoneOffset": -480,
				// 	"year": 119,
				// 	"minutes": 0,
				// 	"time": 1561737600000,
				// 	"day": 6
				// },
				// "userAddress": "北京城市学院",
				// "userPhoneCall": "18810642306",
				// "userRegisterIp": "",
				// "userEmail": "1158545448@qq.com",
				// "userLastLoginIp": "",
				// "userLastLoginTime": null,
				// "userNickName": "Wls",
				// "userType": 1,
				// "userBirthday": ""
			},
			lastLoginTime: 0
		}
	}
</script>

<style>
	@import url("colorui/main.css");
	@import url("colorui/icon.css");
	@import url("colorui/animation.css");
	/*每个页面公共css */
</style>
